<template>
  <div>
    <el-dialog title="配置角色" :visible.sync="value">
      <el-form :model="form">
        <el-checkbox-group v-model="checkList">
          <el-checkbox label="超级管理员"></el-checkbox>
          <el-checkbox label="管理员"></el-checkbox>
          <el-checkbox label="人事经理"></el-checkbox>
          <el-checkbox label="销售经理"></el-checkbox>
          <el-checkbox label="保安队长"></el-checkbox>
          <el-checkbox label="员工"></el-checkbox>
        </el-checkbox-group>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="value = false">取 消</el-button>
        <el-button type="primary" @click="value = false">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
        checkList:[]
    };
  },
  props: {
    value: {
      type: Boolean,
      require: true,
    },
    userList: {
      type: Object,
      require: true,
    },
  },
  watch:{
      userList:{
          handler:function(newValue){
              if(newValue){
                  this.checkList = newValue.role.map(item=>item.title)
              }
          }
      },
    //   checkList
  },
  mounted() {
    console.log(this.userList);
  },

  methods: {},
};
</script>

<style lang="scss" scoped>
.el-form{
    line-height: 40px;
    height: 40px;
}
</style>